<?php
/*  
  Copyright (c) 2010-02 SongCMS 
  SongCMS All Rights Reserved. 
  Support:www.SongCMS.com
  QQ:544255858   19951025
  Author:Song  Version:3.17
  Date:2010-08-12 09:28:32
*/
if(MANAGEMENTLOGIN != 'YES') die('Access Denied.');
@session_save_path(realpath('../tmp/sessions/')); @session_start();
$bodyStyle = !empty($Desktop['Wallpaper']) ? "background:url({$Desktop['Wallpaper']}) {$Desktop['Alignment']}; " : '';
$bodyStyle .= "background-color:{$Desktop['bgColor']}; ";
$bodyStyle .= $Desktop['Repeat']==0 ? 'background-repeat:no-repeat; ' : 'background-repeat:repeat; ';
$bodyStyle .= "color:{$Shortcut['FontColor']}; ";
foreach ($xSystem as $i => &$n){
	if($n[0] == 1){
		$n[1] = $Shortcut['URL'].$n[1];
		if ($n[4] == 0 || $n[4] == 1) $Icon[] = '["' . implode('","',$n) . '"],'; 
		if ($n[4] == 0 || $n[4] == 2) $Start[] = $n; 
	}
}
$Icon = '[' . rtrim(implode('',$Icon),",") . ']';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo WebConfig('WebTitle')?> - 网站后台管理</title>
<link rel="stylesheet" type="text/css" href="./images/adminstyle.css" />
<link rel="stylesheet" type="text/css" href="./songajax/songajax.css" />
<script src="../js/csshovernotie6.js" type="text/javascript"></script>
<script src="../js/songajax.js" type="text/javascript"></script>
<script src="../js/jquery.js" type="text/javascript"></script>
<style type="text/css">
html,body{<?php echo $bodyStyle;?>}
img{border:0; behavior:url(../tools/iepngfix/iepngfix.htc);}
td,tr,td:hover,tr.hover{background:none;}
td{background-color:none;}
#Desktop{}
#Desktop table{padding:10px 0 0 10px;}
#Desktop table td{vertical-align:top;}
#Desktop table .icon{width:<?php echo $Shortcut['Width'];?>px; height:<?php echo $Shortcut['Height'];?>px; text-align:center;}
#Desktop table .icon .text{padding:3px 0 0 0;}
#Desktop table .icon .img a{display:block; padding:5px; margin:0 auto;}
#Desktop table .icon .img a:hover{background:url(./images/index_icon_abg.png) center center no-repeat; behavior:url(../tools/iepngfix/iepngfix.htc);}
#StartList{position:absolute; z-index:2001; display:none; bottom:32px; width:220px; height:530px;}
#StartList #starttoplogo{background:url(./images/starttoplogo.png); height:30px; behavior:url(../tools/iepngfix/iepngfix.htc);}
#StartList #starttoplogo a{display:block; height:25px;}
#StartList #Menu{width:210px; padding:5px 0 10px 9px; height:485px; overflow:scroll; overflow-x:hidden; background:url(./images/index_startlist_bg.png) repeat-y 0 0; border-right:1px #000 solid;} /* w:219;h:500 */
#StartList #Menu div{clear:both;}
#StartList #Menu #List{}
#StartList #Menu #List ol{float:left;}
#StartList #Menu #List dt{clear:both; cursor:pointer;}
#StartList #Menu #List dt .pics{padding:5px 10px 5px 0;}
#StartList #Menu #List dt .pics img{width:25px; height:25px;}
#StartList #Menu #List dt .text{padding:6px 0 0 0; font-size:13px; color:<?php echo $Shortcut['StartColor'];?>;}
#StartList #Menu #List dt .more{}
#StartList #Menu #List dd{clear:both; float:left; width:100%;}
#StartList #Menu #List dd ul{clear:both;}
#StartList #Menu #List dd ul li{float:left;}
#StartList #Menu #List dd ul .pics{padding:2px 2px 2px 30px; float:left;}
#StartList #Menu #List dd ul .pics img{width:20px; height:20px;}
#StartList #Menu #List dd ul .text{padding:3px 0 0 0;}
#StartList #Menu #List dd ul .text a{font-size:13px; color:<?php echo $Shortcut['StartColor'];?>; display:block; padding:1px 5px;}
#StartList #Menu #List dd ul .text a:hover{text-decoration:none; background:#036; color:#FFF;}
#StartList #Menu #List dd ul .more{float:right; padding:3px 10px 0 0; *padding:0 25px 0 0;}
#StartList #Menu #about{margin:0 5px 0 0; padding:5px; *padding:2px; border:3px #BECBD9 outset;}
#StartList #Menu #about a{color:#333;}
#StatusBar{position:absolute; bottom:0; z-index:2001; width:100%; height:40px; background:url(./images/index_statusbar_bg.png) left bottom repeat-x;} /* 状态栏 */
#StatusBar ol{float:left;}
#StatusBar #StartButton{padding:0 0 0 30px;} /* 开始按钮 */
#StatusBar #StartButton a{display:block; background:url(./images/startbutton.png) center bottom no-repeat; width:40px; height:40px; behavior:url(../tools/iepngfix/iepngfix.htc);}
#StatusBar #StartButton a:hover{background-position:top; cursor:hand;}
#StatusBar #Fast{padding:15px 0 0 5px;}
#StatusBar #Fast img{width:20px; height:20px;}
#StatusBar #Fast a{display:block; width:22px; width:22px; float:left; margin:0 1px;}
#StatusBar #Fast a:hover{background:#666;}
#StatusBar #sLogin{padding:16px 0 0 50px; color:#333;}
#StatusBar #oRight{float:right; margin:10px 10px 0 0; height:30px; line-height:30px; overflow:hidden; text-align:right;}
#StatusBar #oRight a{color:#333; font-size:12px;}
</style>
<script type="text/JavaScript">
var songDesktop = {
	winWidth : 0, 
	winHeight : 0, 
	TaskbarHeight : 40, 
	StartListHeight : 530, 
	StartListWidth : 220, 
	ShowIcon : <?php echo $Icon;?>, 
	iconDivWidth : <?php echo $Shortcut['Width'];?>, 
	iconDivHeight : <?php echo $Shortcut['Height'];?>, 
	winSize : function(){ 
		if (window.innerWidth){
			this.winWidth = window.innerWidth;
		}else if ((document.body) && (document.body.clientWidth)){
			this.winWidth = document.body.clientWidth;
		}
		if (window.innerHeight){
			this.winHeight = window.innerHeight;
		}else if ((document.body) && (document.body.clientHeight)){
			this.winHeight = document.body.clientHeight;
		}
		if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth){
			this.winWidth = document.documentElement.clientWidth;
			this.winHeight = document.documentElement.clientHeight;
		}
	},
	aNUT : (navigator.userAgent.toLowerCase()),
	IeTrueBody : function(){
		return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body;
	},
	GetScrollTop : function(){
		return ($.browser.msie) ? this.IeTrueBody().scrollTop : window.pageYOffset;
	},
	floating : function(id,tpe){
		var winsize = this.winSize();
		var Top = (tpe == 'Task') ? ( this.GetScrollTop() + this.winHeight - this.TaskbarHeight) : (this.GetScrollTop() + this.winHeight - this.StartListHeight - this.TaskbarHeight + 8);
		document.getElementById(id).style.top = Top + "px";
	},
	inShow : function(id){
		var idDisplay = $('#' + id).css("display");
		if(idDisplay == 'none'){
			$('#' + id).show(250);
		} else {
			$('#' + id).hide(250);
		}
	},
	songajax : function(id){
		$("#StartList").fadeOut("slow"); 
		return songajax.htmlExpand(id,{objectType:'iframe'});
	},
	inco : function(){
		this.winSize();
		var dHeight = this.iconDivHeight; 
		var table = '<table><tr>';
		table += '<td>';
		$.each(this.ShowIcon,function(i,n){
			table += '<div class="icon">';
			table += '<ol class="img"><a href="' + n[2] + '" onclick="return songajax.htmlExpand(this,{objectType:\'iframe\'});"><img src="' + n[1] + '" width="40" height="40" /></a></ol>';
			table += '<ol class="text">' + n[3] + '</ol>';
			table += '</div>';
			dHeight = dHeight + songDesktop.iconDivHeight; 
			if(dHeight >= (songDesktop.winHeight - songDesktop.TaskbarHeight + 10)){
				table += '</td><td>';
				dHeight = songDesktop.iconDivHeight;
			}
		}); 
		table += '</td>';
		table += '</tr></table>';
		return table;	
	},
	startmarquee : function(lh,speed,delay,id){ 
		var t; 
		var p=false; 
		var o=document.getElementById(id); 
		o.innerHTML+=o.innerHTML; 
		o.onmouseover=function(){p=true} 
		o.onmouseout=function(){p=false} 
		o.scrollTop = 0; 
		function start(){ 
			t=setInterval(scrolling,speed); 
			if(!p) o.scrollTop += 2; 
		} 
		function scrolling(){ 
			if(o.scrollTop%lh!=0){ 
				o.scrollTop += 2; 
				if(o.scrollTop>=o.scrollHeight/2) o.scrollTop = 0; 
			}else{ 
				clearInterval(t); 
				setTimeout(start,delay); 
			} 
		} 
		setTimeout(start,delay); 
	},
	environment : function(){
		var Environments = "";
		if ($.browser.msie && $.browser.version < 7) Environments = '你的浏览器版本太低,建议升级至 IE 7.0或以上版本获得最佳展示效果。<br>';
		var dir_name = document.location.pathname.substring(0,document.location.pathname.lastIndexOf("/"));
		dir_name = dir_name.substring(dir_name.lastIndexOf("/")+1);	
		if(dir_name == 'admin') Environments += '安全提示：您采用默认后台目录名，请更改admin文件夹名称。<br>';
		return Environments;
	}
}
var winsize = new songDesktop.winSize();
songajax.picsDir = './songajax/'; 
songajax.lang.closeTitle = '关闭';  
songajax.allowMultipleInstances = true; 
songajax.expandDuration = 300; 
songajax.restoreDuration = 300; 
songajax.marginLeft = 100; 
songajax.marginTop = 10; 
songajax.marginBottom = 40; 
if ($.browser.msie && $.browser.version < 8){ 
	songajax.marginRight = 30; 
} else {
	songajax.marginRight = 10; 
}	
songajax.width = winsize.winWidth - (songajax.marginLeft + songajax.marginRight);
songajax.height = winsize.winHeight - (songajax.marginTop + songajax.marginBottom);
songajax.outlineType = 'songajax'; 
songajax.wrapperClassName = 'admin-style';
$(window).scroll(function(){
	songDesktop.floating('StatusBar','Task'); 
	songDesktop.floating('StartList','Start'); 
});
$(window).resize(function(){
	songDesktop.floating('StatusBar','Task'); 
	songDesktop.floating('StartList','Start'); 
	$("#Desktop").html(songDesktop.inco()); 
});
$(document).ready(function(){
	$("#Desktop").css({width:"100%",height:winsize.winHeight}); 
	$("#Desktop").mousedown(function(){   
		$("#StartList").fadeOut("slow"); 
	});
	$("#StartList").css({width:songDesktop.StartListWidth + 'px',height:songDesktop.StartListHeight + 'px'}); 
	$("#Desktop").html(songDesktop.inco()); 
	$("dd:not(:first)").hide(); 
	$("dt").click(function(){
		$("dd").slideUp("fast"); 
		$(this).next().slideDown("fast"); 
		return false;
	});
	$.getScript(OfficialAnnoURL,function(){
		if(typeof(OfficialAnno) == 'undefined') {								 
			$("#oRight").html(songDesktop.environment());
		} else {
			$("#oRight").html(songDesktop.environment()+OfficialAnno);
		}
		var xTime = ($.browser.msie) ? 3 : 20; 
		songDesktop.startmarquee(30,xTime,5000,'oRight');
	});
	<?php if($_SESSION['Logins'] <= 2){?>
	$("#StartList").css("display","block"); 
	<?php }?>
});
</script>
</head>
<body>
<div id="Desktop"><!--桌面图标--></div>
<div id="StartList">
	<ol id="starttoplogo"><a target="_blank" href="http://www.songcms.com/"></a></ol>
	<div id="Menu">
		<div id="List">
		<?php 
		foreach ($nMenu as $i => &$n){
			if($n[0] == 1){
				$n[1] = $Shortcut['URL'].$n[1];
				echo "<dt><ol class=\"pics\"><img src=\"{$n[1]}\" /></ol><ol class=\"text\">{$n[2]}</ol><ol class=\"more\"></ol></dt>\n";
				echo "<dd>";
				foreach ($Start as $v => $w){
					if($w[5] == $n[3]) {
						echo "<ul><li class=\"pics\"><img src=\"{$w[1]}\" /></li><li class=\"text\"><a href=\"{$w[2]}\" onclick=\"return songDesktop.songajax(this);\">{$w[3]}</a></li><li class=\"more\"><img src=\"../images/article_elite3.gif\" /></li></ul>\n";	
					}	
				}
				echo "</dd>\n";
			}
		}
		?>
		</div>
		<div>&nbsp;</div>
		<div id="about">
			版本：<a target="_blank" href="http://www.songcms.com/?fbuy"><?php echo $CMSVersion?> (<?php echo $CMSWithin;?>)</a><br />
			发布：<?php echo $CMSUpDate?><br />
			网址：<a target="_blank" href="http://www.songcms.com/">www.songcms.com</a><br />
			论坛：<a target="_blank" href="http://bbs.songcms.com/">bbs.songcms.com</a><br />
			客服QQ：<a href="http://sighttp.qq.com/cgi-bin/check?sigkey=bdc77ce5ff0add5e24c05c772ba74dc919a1fe42cef9a33cf15124e686a122da"; target=_blank; onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=bdc77ce5ff0add5e24c05c772ba74dc919a1fe42cef9a33cf15124e686a122da';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;">544255858</a><br />
			电话：0760-88893984
		</div>
		<div>&nbsp;</div>
	</div>
</div>
<div id="StatusBar">
	<ol id="StartButton"><a href="javascript:songDesktop.inShow('StartList');" title="开始菜单"> </a></ol>
	<ol id="Fast">
		<?php
		foreach ($oFast as $i => $n){
			if($n[0] == 1){
				echo $n[4] == 'iframe' ? "<a href=\"{$n[3]}\" title=\"{$n[2]}\" onclick=\"return songajax.htmlExpand(this,{objectType:'iframe'});\">" : "<a title=\"{$n[2]}\" target=\"{$n[4]}\" href=\"{$n[3]}\">";
				echo "<img src=\"{$Shortcut['URL']}{$n[1]}\" /></a>";
			}
		}
		?>
	</ol>
	<ol id="sLogin">
		管理员：<a href="AdminPassWord.php" title="修改密码" onclick="return songajax.htmlExpand(this,{objectType:'iframe'});"><?php echo $_SESSION['UserName']?></a>&nbsp;&nbsp;
		级别：<?php if($_SESSION['levels']==0){echo '普通管理员(受限)';} else {echo '超级管理员';}?>[<a title="退出登录" href="index.php?Action=Exit">退出</a>]
	</ol><ol id="oRight"></ol>
</div>
</body>
</html>